package com.zjxf.service;

import com.alibaba.fastjson.JSONObject;
import com.zjxf.base.bean.po.CmsSchoolNews;
import com.zjxf.base.bean.po.UmsStoreSeller;
import com.zjxf.base.bean.ro.RoCmsSchoolNews;
import com.zjxf.base.bean.vo.VoCmsSchoolNews;
import com.zjxf.base.common.OperationException;
import org.springframework.data.domain.Page;

/**
 * 新闻
 *
 * @author ZhangWei
 * @date 2021/4/6/006 10:51
 */
public interface CmsSchoolNewsService {

    /**
     * 添加新闻
     *
     * @param vo
     * @param umsStoreSeller
     */
    void addOrUpdate(VoCmsSchoolNews.addOrUpdate vo, UmsStoreSeller umsStoreSeller);

    /**
     * 删除新闻
     *
     * @param id
     */
    void delete(Long id) throws OperationException;

    /**
     * 回显
     *
     * @param id
     * @return
     */
    CmsSchoolNews getEntity(Long id) throws OperationException;

    /**
     * ro回显
     *
     * @param cmsSchoolNews
     * @return
     */
    RoCmsSchoolNews.Details getEntityRo(CmsSchoolNews cmsSchoolNews);

    /**
     * 分页
     *
     * @param filter
     * @return
     */
    Page<CmsSchoolNews> page(VoCmsSchoolNews.filter filter, UmsStoreSeller umsStoreSeller);

    /**
     * ro分页
     *
     * @param page
     * @return
     */
    JSONObject pageRo(Page<CmsSchoolNews> page);

    /**
     * 状态切换
     * @param vo
     */
    void switchShow(VoCmsSchoolNews.SwitchShow vo) throws OperationException;
}
